package inter;

import lexer.Num;
import lexer.Word;
import lexer.Token;
import symbols.Type;

public class Constant extends Expr {
	public static final Constant 
		TRUE = new Constant(Word.VERDADEIRO, Type.BOOL),
		FALSE = new Constant(Word.FALSO, Type.BOOL);
	
	public Constant(Token tok, Type p) {
		super(tok, p);
	}

	public Constant(int i) {
		super(new Num(i), Type.INT);
	}
	
	public void juming(int t, int f){
		if( this == TRUE && t != 0){
			emit("goto L" + t);
		}else if( this == FALSE && f != 0){
			emit("goto L" + f);
		}
	}
}
